SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[paObtenerReparticionResponsable] 

@IdTramite INT,
@Reparticion INT OUTPUT

AS
SET NOCOUNT ON
SELECT @Reparticion = ISNULL(A.Reparticion, 0) FROM tb_TramitesDocumentos T 
	LEFT OUTER JOIN tb_AsuntosDeTramite A ON T.Asunto = A.IdAsuntoDeTramite
	WHERE IdTramite = @IdTramite

RETURN
GO
GRANT EXECUTE ON  [dbo].[paObtenerReparticionResponsable] TO [GestionDeDocumentos]
GRANT EXECUTE ON  [dbo].[paObtenerReparticionResponsable] TO [SoloVer]
GO
